package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.RewardAllocation;
import com.sc.nft.mapper.RewardAllocationMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class RewardAllocationDao extends ServiceImpl<RewardAllocationMapper, RewardAllocation> {

    /**
     * 根据活动Id查询活动配置内容
     * @param activityId
     * @return
     */
    public List<RewardAllocation> getRewardByActivityId(Long activityId) {
        LambdaQueryWrapper<RewardAllocation> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RewardAllocation::getActivityBasicsId,activityId);
        return baseMapper.selectList(wrapper);
    }
}
